Skip to content

Convert an IP address to a geohash code based on the latitude and longitude

Use the ip_to_city_geo function to obtain the longitude and latitude based on an IP address. Use the geohash function to convert the latitude and longitude into a geohash code. The results are displayed in a table.

SQL
|
SELECT
  geohash(ip_to_city_geo(client_ip)) as "Convert an IP address to a geohash code"